<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">主体信息</ui:define>
    <ui:define name="content">
        <h:form>
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton value="编辑" icon="fa fa-edit"
                                         actionListener="#{settlementCompanyInfoBean.changeStatusToEdit}"
                                         process="@this"
                                         update="@form" rendered="#{settlementCompanyInfoBean.isView()}"/>
                        <p:commandButton value="保存" icon="fa fa-save"
                                         action="#{settlementCompanyInfoBean.onSave()}"
                                         update="@form"
                                         rendered="#{settlementCompanyInfoBean.isAdd() || settlementCompanyInfoBean.isEdit()}"/>
                        <p:button value="返回" icon="fa fa-reply-all" href="#{currentUserBean.back}"/>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-g ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12 ">
                    <div class="ui-g-12 card">
                        <h1>基础信息</h1>

                        <div class="ui-g-12">
                            <div class="ui-g-2">
                                <p:outputLabel value="开票主体"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="companyName" value="#{settlementCompanyInfoBean.$.companyName}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="是否开票"/>

                            </div>
                            <div class="ui-g-4">
                                <p:inputSwitch id="isBill" onLabel="是" offLabel="否"
                                               value="#{settlementCompanyInfoBean.$.isBill}"
                                               disabled="#{settlementCompanyInfoBean.isView()}">
                                </p:inputSwitch>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="开票内容"/>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="billContent" value="#{settlementCompanyInfoBean.$.billContent}"
                                                 disabled="#{settlementCompanyInfoBean.isView()}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{settlementCompanyInfoBean.dictionaries[DictionaryCode.SETTLEMENT_BILLING_CONTENT]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="发票类型"/>
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneMenu id="billType" value="#{settlementCompanyInfoBean.$.billType}"
                                                 disabled="#{settlementCompanyInfoBean.isView()}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                                  noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{settlementCompanyInfoBean.dictionaries[DictionaryCode.SETTLEMENT_BILL_TYPE]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectOneMenu>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="登记税号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="taxNumber" value="#{settlementCompanyInfoBean.$.taxNumber}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="电话号码"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="phone" value="#{settlementCompanyInfoBean.$.phone}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>



                            <div class="ui-g-2">
                                <p:outputLabel value="开户账户(单位名称)"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="bankAccount" value="#{settlementCompanyInfoBean.$.bankAccount}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="开户支行"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="offlineCount" value="#{settlementCompanyInfoBean.$.bankAddress}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="开户卡号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="bankNumber" value="#{settlementCompanyInfoBean.$.bankNumber}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="开票地址"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="billAddress" value="#{settlementCompanyInfoBean.$.billAddress}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="收件人姓名"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="receiveName" value="#{settlementCompanyInfoBean.$.receiveName}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收件人手机"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="receivePhone" value="#{settlementCompanyInfoBean.$.receivePhone}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="收件地址"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText id="receiveAddress" value="#{settlementCompanyInfoBean.$.receiveAddress}"
                                             disabled="#{settlementCompanyInfoBean.isView()}"/>
                            </div>

                        </div>

                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>